def match(txt: str, pat: str):
    i = 0
    n, m = len(txt), len(pat)
    result = []
    while i < n - m + 1:
        j = 0
        while j < m:
            if txt[i + j] != pat[j]:
                break
            j += 1
        else:
            result.append(i)
        i += 1
    return result

print(match("abababa", "aba"))